added fos.close()