changed error from int to char