Added ability to clear database. fixed map so it updates immediately
when entries are deleted