Made the payment concurrent code thread-safe