Submitted form not populating correctly