corrected some fatal errors