invalid characters bug fixed