Fixed a bug by integrating