In the traditional indoor positioning systems, because of high cost or various environmental interferences, most existing technology such as GPS, Bluetooth and RFID are not so useful. Pedestrian Dead-Reckoning (PDR) is a kind of low-cost location positioning technique that can get high accuracy by estimating the heading angle of target from acceleration, gyro and compass data. Usually, researchers use compass data to estimate heading angle. However, the compass data is easily affected by external environment, such as electrical equipment or some objects made by iron or steel. On the other hand, the calculation results by the obtained data of acceleration and gyro usually have accumulated error with time. When time comes longer, the bigger error often appears. Some researchers use Wi-Fi based on received signal strength indicator (RSSI) to assist PDR for correction. However, some Wi-Fi Access Points (APs) cannot be used because RSSI can be affected by external factors, such as people moving, wall. In this paper, a novel method that can improve PDR by heading correction is proposed. In this method, heading angle is estimated by calculating the yaw angle with Quaternion from acceleration and gyro data, and optimal APs selection method is used to select suitable RSSI for getting high accuracy.