private static ConnectionHandler getConnection() {
        for ( ConnectionHandler c : connections ) {
            if ( !c.isUsed() ) {
                return c;
            }
        }
        // create a new connection as none are free
        Connection connection = null;
        ConnectionHandler ch = null;
        try {
            Class.forName( "com.mysql.jdbc.Driver" );
            connection = DriverManager.getConnection( "jdbc:mysql://" + MainConfig.host + ":" + MainConfig.port + "/" + MainConfig.database, MainConfig.username, MainConfig.password );
        } catch ( SQLException | ClassNotFoundException ex ) {
            System.out.println( "SQL is unable to create a new connection" );
        }
        ch = new ConnectionHandler( connection );
        connections.add( ch );
        System.out.println( "Created new sql connection!" );

        return ch;

    }