fixed bash scripting mistakes