fixed errors with code