added support for bidirectional rule