added script wrapping