bug: recognize when cursor is at end of word