js addons object check refactored