Added thens to if blocks

It still won't build properly. See uploaded issue.