fixed wrong value check