Add check type of before indexOf method.