You are leaving open file handlers