fixed undefined variable error in widgets