new version without reference errors