flight count migration, pages controller, and main.js changes