remove appending of non-existing elements