fixed some bugs for each script from last nights coding