Fix method to know if a dir is empty or not