add 'options' in attachResource(); fixes #45