functions used in indexes must be immutable
bug fixes