fixed a bug in the bash script