make sure db query happens on main thread to avoid
the multiple thread issue with fmdb.