scheduler is almost working