added a conditional for the caption