Fixed bug cannot call method tostring of null