fixing bug in add