added ability to set undistortion mode