remove old template and add new one