fix NULL exception