Please pay attention to the word "-는데" which connects two sentences that are related. The sentence that comes front of '는데' is a speaker's background information that results the right after sentence question.