fixing bug after refactoring + location tracking