removed extraneous if block