Fix automation cursor position issue