fixes #53, use an internal array indexOf instead