Fixed bug where old frames were being reused
Implemented pipe detection