Fix file handle not closed
Remove debug