Add/Edit functionality fixed