Added support for nested conditions