bugs in bash files because of rearranging the files