next-not-NULL bug fixed