ie 8 compatibility, replace indexOf method