added cursor lock (properly)