Add a test case for adding multiple resources and fix the bug