fix gates