fixed remaining bugs