added additional validation for input values