Added guard and spork functionality for automatic testing