How come when I sleep my period stops?

Every night I use a night pad and its always clean when I wake up, I thought it was over and then about half an hour it starts flowing regularly?

Something wrong or why does this happens.