changes to be compatible with upstream build