Fixed a bug in integration