fixed database conectivity