built a function to read the configuration
Combinded code
found the bug, the fps is also read