Fix a race condition in updating the position in the sequence and the current canvas identifier