changed order of executiion