fixed a bug on string comparison in shell script