Fixed variable in custom function issue

Adding variables in the parameters of custom function was causing very
strange behavior. Every time you pressed enter the value increased.