added autocommit feature