fixed various errors