updated SGScript, fixed bug in current context destroying code