Fixed undefined object error.