Except for error code 0 detection, rest of the code are almost freezed