read config file properly (sort of)