adding messageSync and cursor. working