Fixes user-defined function error