Move params check higher