fix up security flaws