fixed ls infinate loop