Added validations and tests for it