changed to make it fit new code