Fixed bug with cancel