fixed undefined var