reworking Thread.sleep, making the scheduler async