fixed runtime errors of null object