Fixed database connect