fix bug that still save pictures after cancel select directory dialog