Thanks. I will update it to use finalize method. Using reference count seems a bit confused in Java programming.