Make cancel button work