fixing add func