added commit method to all classes