fixed several errors