fixed the ls issuse, it actually had to do with opendir