fix a return value of a function to be bool

the function returns bool and was checked incorrectly