fix sqlite statements