Fixed NullPointer crash issue.