tried to fix some more bugs