Seems like you forgot to remove the old input element here.