Adds check for logged in users
Fixes Heroku issues