proper check for authentication