use empty? method instead of Dir[...].count