fixed some bugs in pipeline and mysql