added scheduler logic