fix bugs on resources