added check to prevent deletion of the current directory