Bugfix leaveActivity