recusrive insert function does not work