Fix trigger method. Add logic to remove client on close.