comit logic