untested fix for #310, needs to be tested on xcode