Call get_and_delete_messages() only if user is logged in, don't fail when user logouts