modification of loggedin check