fixing cursor bug