public ZFrame pop() {
        if (frames == null)
            frames = new ArrayDeque<ZFrame>();
        try {
            return frames.pop();
        } catch (NoSuchElementException e) {
            return null;
        }
    }