fixing bash scripting problem