better event handlig, not done yet