Fix Sctipt auto closing

Change-Id: I1bc8bffb94a8d04b69e79b28e172f0169eebb3b8