updated condition parsing