Fix infinite loop with retrieving payment amount