fix problem when system go into sleep mode