fixed bug when discovering location