hackery to get around lack of hoisting in compiler