fix bash script for missing var