corrected the bash script