fixing bad db connection

died on null pointer.. need to clean up after myself