fix a  bug with condition and default value + add directve for registration
resolve conflict