casting encrypted codes to string, fixing generator