fixing jshint violation: using new before calling constructor