Added windowClose dialog functionality.