add exception handle to parser