You have checked url above so the first 2 checks should be unnecessary.