Bug fix, was not returning the value of the condition