fixed contains() function