fix for undefined var