Updated script to merge and pull latest changes properly