finally got autocommit function working properly