mondai ni sumimasen keredomo, kiite arigatou gozaimasu.
I'm no expert, but if you're trying to very politely thank some one, that's one way of doing it. For a friend, something like "Mondai ni suman kedo, kiite arigatou" might be fine. Some one double check me, though.