updating values is almost there, having strange issue with template