add path check to config.c, remove tail slash