Implemented check for being logged in