Thanks for all the replies. I have one more doubt in my mind..Pls clear this

If a person prayed to God for something and vowed to do something in return if his wish gets fulfilled, can he fulfill his vow to God in advance, before his wish gets granted? Will God accept that vow which was completed in advance before his wish gets granted?

Also, if the person's prayer gets answered in future, do he has to fulfil his vow again?