Compare value correctly