changed scripting API a bit