Updated script to use bash instead of sh