Bug fix, was not  comparing the correct types