fixes leaking files