Fixed issue with cancel not working on dialogs