modified the commit handler for cases