added setRedirect and getRedirect, fixes #21