show errors in alerts and fixed reload state when saving a new document