improved script compatibility