It was being checked as a bool but was returning int.