Move the normalize URI to the beginning. You are doing it twice.