Refactored code
bookmarks db wasn't close