add checks to parse_p