Fix function to boolean error