Made code a bit more readable
Fixed url rule being applied when it shouldn't