this should be generalised so it is called everywhere in a similar matter