Added redirect url
Added support for multiple document types