switched to in-template ajax check