solved filehandle problem