added another test if all nested conditions are true