fixed error in merge, added keyword validation