autocomplete script optimisation - delete styles and edit script