Uproved counting files in directory. Omitting directories
Calling only script files and not directories