template problem with no lines to end