fix codes generator