refactored onRequest
added file