bugfix: forgot to put SCRIPT_DIR as globals