fixed issue with connection ending too soon
made templates handlebars templates