Fix bug in events model