Added different check for isRequestContext to allow mock objects
Upped version