emergency stop bug fixes