Added additional validation of type