SD card works in setup but not in loop

I didn't want to write my complete code, since the sd businesslogic is only a small part