Arduino stop accepting command form ps3 controller

ps3 gets connected to Arduino, and i checked every button press. it works fine and shows every click, but when I try to call any function on click, function gets completely executed. But after that Arduino stop accepting command but it shows that Arduino is still connected. I debugged function and execution comes back to void loop but it doesn't accept command from ps3. It shows Arduino is still connected to ps3. I an not able to figure out where the issue lies. can someone please suggest any solution