Added imput validations.