Added a check before proceiding in enc and delete directory files