updated code based on https://github.com/symfony-cmf/BlockBundle/pull/125