Added support for custom variables in block and parent function