handle params and redirects