refactored onlocationreceived