replace stub automatically