still having hard-to-track problems. will revert after this commit