Fix contains function bug