Fixed run after window loaded