@Override
    public synchronized void execute(final Runnable command) {
        tasks.offer(new Runnable() {
            public void run() {
                try {
                    command.run();
                } finally {
                    scheduleNext();
                }
            }
        });//insert one task
        if (active == null) {
            scheduleNext();
        }
    }