fix sleeping issue