more accurate http errors, attach handle tty correctly now