adjusted code to work with cmf-sandbox