added polling functionality so the program won't break while a file is actively transferred