fix target name issue and add support of external config file