added debug options in config file
fixed all functions for domains.