fixed bug in contains method