funky CS fails to check for undefined. Workaround.