Fixing position of if gate