fix undefined offset error message