Added validation and test for it