LPS-44324 Put the checks in the correct place