updated login to check user status