new script functions for ids and types