fixed carriage-return detection