add exception handler for parser write