A nicer way to determine if a view is active, and fixed issues with flight query