Problem with the caption position

The container of caption should be inside the parent block and not before