fixed the most grevious errors