merge data properly