add the element at first and remove it when possible; fix the wrong error message