Fixed issue where adding a new row caused multiple inserts into the database.