fix login and location registration queries