Added a protocol check mechanism to form cleaning