fix connection loop & add schema config