Need help to detect error in code for POS system - C#