fixed rest condition parsing