fixing final bugs