This link should help
Inside a substitution you need to escape } as }} instead, to prevent the substitution from ending early.