Fixes connecting to DB