put db access to background thread.

line 310 make the Handler to run on UI thread.