fixed undefined object errors if not logged in