fixed the bug that prevented my script from cooperating