Fixes redirect bug