moved connection creation into run function