figure out much more elegant fix for previous commit