encode script to base64 once, while reading script