Fix program flow