improved wakelock handling