added Reference type
fixed lock reference type when saved