delete function improved to resolve memory leak, if particles are destroyed by the boundary condition