added code to check entered values