make cancel button on database dialog work correctly