seperated cog startup code to allow cog restart