fix template alignment bug