Set default code if is not valid