more fixes to my bash script