remove fclose from read_input