Added -r flag for directory deletion