checking error object
Error checking on min and max value