fix bug with determining location