add boundary to the gates