fixed some errors with code