bug fixed with merge code