more checks for undefined

Change-Id: I7c7b3046a5457f71e272d33656582b7cd7ac1d35