fixes template, error if key doesn't exist