make script a little sturdier