fixing more bugs. linting would help here.