Sell glitch fixed, new system for handling flags