Edited and deleted elements now also get updated in the database. When editing or deleting a single element, it won't update in the map; need to fix