Fixing bug in updating marks