backend: fix data direction flow check