Try doing them in a thread because Shell functions you are executing are at times time consuming