make view and template work together