safe onEnter and fix die looping.