update to fix undefined variable