allow hashref in constructor