fixed for dealing with the different versions of ls