closes #748 but needs to be tested