Fixed error when logged in as admin