fixed find one sleep, code cleanup