inserting products has been added, catching of sql query errors has been added to save transaction