fixing cancel operation