Add callback at methods open and close