I found my error (a quite embarrassing too).
I had an "old" line in my code which asigns a pointer to the wrong struct and that caused the crash.
Now the code works absolutely fine and does exactly what i want.

kind regards