Fixes a bug while disposing resources