fixed template bugs in cloud