fixed bug in determineVisibleCondition