bugfix for older R versions