adding a nil guard for request env