commiting after checking the data