fixed localref cursor positioning bug