fixed getCurrentScript's bug