fix cursor offset.