adding back in @coreyzev's changes