Added isValid check to the pre-configured constructor