fixed bugs for ls