added if statement to fix null captions