test and fix for undefined