working with sqllite correctly