Fixed error in code from teacher