fixed server crash for sure, added in and out events