fixed undefined offset #2276