updated so works on change