switched to scheduler and removed var