Fixed error with non-const function