fixing template bracket issues