more fixes to shell script