Ari4java dtmf input not coming in sequence

Hi i am trying to create an ivr application using ari4java library my ari version is 4.1.2
and asterisk version is 16 . I am trying to playback dtmf digits on input however the the sequence of inputs and the sequence of playbacks are not in sync when i the dtmf inputs are punched in rapidly. Any solution to this?