fix forgotten return statement causes SEGV
check if captured symbol is invalid