first code changes to make it compatible to new epoch version