fix doc is undefined