modify getLevel method.