changed cancel button behavior