adding support for asynchronous templates