Bugfix for issue #40

- added attribute checking and default setting before creating a new resource