fixed null exception in unitscript