removed duplicate code from merge