Fixed cancel button bug