logout on error