fixed old/new code issues