updated cancel method, support ios7