implementing cursor patch