fix setup_db and add comments