added exit value for successful/failed merge