added and fixed template device example