integrated fix from master branch, try to get pix working, but failed so far :/