re-added modifications/cleaning from previous commit
fixing inverted from/to when coming from url