fix crashes of ScriptActivity and Fragments if memory is cleaned externaly