ok it was only an outputt.close(); in the end of try in method write_new_record and my program worked.:cool: