fixed ls check bug, added basis for -l flag