enhance scripting, correct layer creation