Add sleep logic