Added checking if the user is logged in on each request. Fixes #4