removes trailing ampersands