fixed NullReferenceException on end trigger
idk a lot of stuff