fixed a bug with buff overwrite