updated for latest from upstream