fixes some more bugs