fixed detection for first line of COS method