Fix possible accessing to null object