Fix the bug for multiple instances