adding support for automatic client redirect