Check val before decode