fixed return code added isMerged