bug fixes after adding the code for cfg files