changed behaviour of merge to avoid values getting overwritten by null values