use string methond indexOf instead of contains to fix firefox browser bug