moving more logic back