Well the solution was quite easy.
My values are stored in a ring buffer and this buffer was to small when the program was busy doing other things and lost some values.