Fixed if statement check

Needs to check that value equals 1 instead of -1