Fixing detached head on cms reference