use indexOf instead of contains because webkit doesn't support it