Fixed small error with 2 pass encoding

Fixed small error with 2 pass encoding