fixed resources bug,  config refactor (bad)