add debugif thread to main