patched to support using a renderOptions function as option