Give the attached VI a try. It is a quick and dirty fix, by this I mean that it could also have been fixed by adjusting the exclusive or logic part, but it should do the job. Please feel free to let me know if it isnt what you were looking for or if you have any other questions.
Cheers