Fix thrown undefined error when not logged in.