Program Crashing when PHD starts to capture