Added code to prevent freezes after a computer has been in sleep mode