read write to config file and fixed bug with configport