cleaning up gate