Fixed a issue with calaulate payments