fixes for lua thread when calling during running, not allowed, clone lua script to do so