Added counter to check if content length exceeds a defined limit