simplify handle_setup
fix debugging