Edit 2 of making compatible with pre-10.8 OS X