fixed most of errors