fixes bug for logged in users