better caption handling