some fixes, but i broke it :(