fix a bug in cursor.

Signed-off-by: Daogang Tang <daogangtang@gmail.com>