fix a bug crashes caffe