fix logic in process request