Added a small check to dialog response