improved request validation