fix add functionality