Fixing issue with caption creation