Added validation on inputed data