Files sort

check if programs are runing before sorting