redirect to correct page after login