script files and register function