Unhappy [Q] Phone keeps waking up while in flashmode

Hello. I'm trying to root my device by downgrading it first. So i need to flash the rom. I had my phone in flashmode. But in a minute or two the phone will wake up. And i can't continue my flashing because of that. Anyone know supposed to be the problem? Sorry im noob at this stuff