fixed cancel and cleaned up some of the code
merge 'cancel' into 'develop'