fixed script call on refresh