removed unnecessary if block