Fixes in server sql , implemented a config file option