remove script safely.