adopted to latest opengm changes