fixed an error caused by counting \n and etc
fixed an error caused by counting \n and etc