fixed undefined var in production mode