fix remaining bugs