add some exception handling for parser