removed multiple calling of side-effect functions #8