fixing adding logic