added some validatation