added function "checkValue"