some modification in parsing function