reenforce type check on object constructor