fixed major errors