more robust code for autocomplete fill after creation