swap conditional order so that short circuiting works as expected