put master to 0 when closing it