fixing lots of errors