make the distinction between files and directories when deleting