changed surrogate loading function