fixed issues with sqlite database