changed order of condition