Fixed templates php code