try checking equal to a value instead of nil

it shouldn't ever be -1 anyway