Crashing when double call scriptAPI fixed