Common problem. If you're still under warranty, dealer should fix at no charge. I had mine done twice. Water gets in the rear latch assembly so it has to be replaced with a 'newer' design. (So the dealer says

)
They had to paint the trim piece along the BMW emblem as well and replace the latch.