moved db connection outside of app