cart validation middleware