fixing offset issue