replace Object.getOwnPropertyNames with (for .. in) for cross browser compatibility