there is an error of nil class here if i have no children, so make a if condition to check if @child == nil if its true then output any message instead of the rest of the code, else do the rest of the code