Updated how the system connects to the database