uses the function which also removes from config