Implemented cancel button handler