implemented removeById function