Hey, welcome to the forum

You didn't mention getting excited, so I don't know if that's the reason. It could be that you're becoming lucid towards the end of the dream anyways, in which case there's not much you can do. Just control what you can, continue to stabilize the dream whenever it's necessary, and stay calm.