* fix function in a loop for file sending and preview