Changed hide/show logic of caption