Added validation middleware