db fix and connection