merge upstream improvements