correct typo
char if correction
update with Daniel's fix for char var