move sqlite so it isnt called more than once