move init_db code at the good place