added timer thread to stop spdet and added -spdet flag

timer thread isn't finished yet