fix connect to database