fixing when file should be send logic