fixes database issues