FIXED a variable overwriting issue that caused it to only work on mac os x