Fix bug happens when replacing require()