added cursor restore