add redirect to previous page on register, fix redirect on sign in