Fixed a bug when adding