undefined bug fixed