updated for login query