Upgraded codes bugfix