fixed bug where client crashes onLoad