Added check for logged in user, fixes #441