added logic to support 10.6-10.9 as well as exit return codes