fix issue when loading from javascript