fixed bug in merge