register script in init hook