added mutex stuff to schedule (else statement)