Fixed undefined problem