Added additional logic.