better handling of cancel for password dialog