fixed cursor offset problem