fixed some last remaining bugs