document updating implemented, added globalErrorBlock for centralized error handling