insert function is working