bugfix with an character to integer conversion