Make db call on a separated thread