adds check for user log in