checks if directory exists before deleting

Signed-off-by: Blessing Osakue <iyoworks@gmail.com>