Merge add and edit functionallity