fix cursor and add hook attach