fix js bug in cancel