added back a few changes from v6.4