added check for user login