Ensure config & database is accessed correctly in the main class