I haven't look at your code.But yeah at first glance you need to check your switch statement you need to add break;..What's happening rite now is a fall through and all functions are being called