fixing offset and limit