simple validation middleware