populate apphtml after it is created rather than before