changed back cleverness so it works right on friendly urls