imroved the ls_dir test function