added a demo and made the validator accept params