added logic to find the parent of a given comment