fixed issue with templates and uploads