fixed cancel button crash.