preventing 'apply' method call on undefined obj
Merge pull request #78 from lucianocosta/patch-1

preventing 'apply' method call on undefined obj