fix bug in IE<=9 where indexOf is not supported