Hi Jing,
Tim's correction is exactly right. I'll just add that this construction is called the third conditional. Something didn't happen (or in this case did happen) in the past, so something else didn't happen (or in this case did happen) as a result.