Move request out of the if block.