fixes some issues with the template view