Default [Q] Xperia x8 touchscreen acting weird

Hi all! I've been using X8 fir a long time now and it didnt show any problems at all recently. It was working fine, no problems at all. And it just started acting wierd. Sometimes it doesnt act respond properly, sometimes it starts acting on its own and sometimes it just freezes and doesnt show any signs of response till i pull out the battery.
I tried reflashing back to stock rom but the same problem remains. Is it a hardware problem or software related? Any help please? Thanks