Fixed recursive error

fixed pause.resume and change priority