used thread locals instead of global_request