dynamically add and remove the captions