Fix disappearing cursor bug