insert function is working now