duh, moved file check ahead of connection attempt