fixing template and setting collision issue