bugfix generate reward codes