remove extraneous end