handle empty code case