to add hidecursor function