Updated check for changing a parent