fix sleep/wake issues