don't do DB access in ui thread if possible