small refactor - enable function after ajax