solve caption placement problem