fixed undefined offset