My 3GS has a nasty habit to crash right before my alarm goes off. I often wake up to find my phone has a black screen with a frozen loading circle in it. By holding the power button and the home button I can reset it and it boots up again without a problem. The strange thing is, it sometimes randomly crashes like this. So I thought it might be a battery issue. But I plug it in at night so when it crashes right before my alarm goes off it has to be something different. Maybe it's an issue with iOs 5, because this never happened before. Is there anyone who has a clue what is wrong and what I can do to fix this?