fix bug with sqlite db connection