try to fix some of the issues, add output type control