bug fix in shell script