solved ticket 3218

I didn't test it yet but it should do the trick