fixed maximum stack size, missed .val() function