[develop] added some logic ,not tested. TODO: SLEEP......