Apple has blamed a bug for surreptitiously tracking iPhone and iPad users' locations and has promised to release free software to remedy the problem in the next few weeks.

The company came under fire when it was claimed that a file on the "devices" file on the products contained a record of everywhere users had been.

But Apple said in a statement that a bug was responsible for updating Wi-Fi data even when consumers turn off its Location Services. Apple said it had never tracked users locations and has no plans to ever do so.

"The iPhone is not logging your location. Rather, it's maintaining a database of Wi-Fi hotspots and cell towers around your current location, some of which may be located more than one hundred miles away from your iPhone, to help your iPhone rapidly and accurately calculate its location when requested," said the company.

The technology giant said it will release a free iOS software which will prevent the devices from storing location-based information when the services are switched off.

However, two Apple customers have already filed a lawsuit against the company claiming that their location-based services puts users at a serious risk of privacy invasions and stalking.

Several members of the US Congress have also demanded explanations from Apple, Google and others about what they compile from increasing powerful smartphones, reported the Financial Times.
Apple is ready to fix iPhone 4 and iPad tracking the location Dilemma