Commit after javascript callback function implementation