added sort function after listDir for Linux system