Added method to check if directory is empty