better redirect handling
better distinction between errors