Fix for generateAjax