use -e check instead of ls