Pre-populate form with data from a previous submission is not working properly