bug fix for indexing constant functions