fixed a missing 'end' introduced by the last merge