fixed bugs especially in location manager