merge a couple local changes, need to test if these are still necessary