fix error with nil teacher