improve headposeadviser. add it to portal. fix a bug in portal