fixed runtime issues caused by zero offset
address offset boundary issue