return 0 cs when detecting errors