copied from demo to template