fix bug in cog