fixed vaious errors