safe parsing modified