adding insert function in the database