switched events + bugfix