fixed testing regex
fixed some errors and typos, added to self-restarting