Modified the contains function not to crash on nil input :)