added domain plus minor code changes