fixing template match regex