Wastewater recycle using membrane bioreactor