cleanup options and add more diagnosis