Fix cancel callback

remove infinite loop, fix cancel callback, improved comments