added error-checking right after downloading, also closing filehandlers now... may save some ram