fix gamma on detach