Assalamu alaikum,

I understand that if one reaches the monent of death rattle and he is still a Muslim and it happens that he commits a sin, will then his sin be still written? Or his books of deeds are closed when death rattle comes and when Sun rises from West comes? Because, the reason I'm sayin' this is because when these signs comes then the door of repentance is closed and no more convertian to Islam is accepted by any non Muslim.

I mean, if I will reach death rattle and I by mistake commit disbelief, then will this be written or will I still be Muslim at that time and will I die as a Muslim?

P.S. I ask this so that I can understand only.